//--------------------------------------------------------------------
//     此代码由FastEasy框架自动生成
//	   生成时间 2023-09-30 01:23:01
//     对此文件的更改可能会导致不正确的行为，并且如果重新生成代码，这些更改将会丢失。
//--------------------------------------------------------------------
using FastEasy.Common.Jwt;

namespace FastEasyAPI.Controllers
{
    /// <summary>
    /// Base控制器接口
    /// </summary>
    [Route("[controller]")]
    [ApiController]
    public class BaseController : ControllerBase
    {
        private readonly IBaseService service;

        public BaseController(IBaseService _service)
        {
            service = _service;
        }

        [HttpGet]
        public void c(string name)
        {
            service.CreateModels(name);
        }

        [HttpGet]
        [FastEasyRoute(SwaggerVersion.FastEasy, "GetToken")]
        public ResultDto GetToken()
        {
            var token = JwtHelper.CreateJwtToken(new TokenModel
            {
                Aud = "all",
                Iss = "FastEasy",
                Jti = "1",
                Name = "张三",
            });

            return new ResultDto
            {
                Data = token,
                Message = "Ok",
                State = true
            };
        }
    }
}